<template>
  <swiper class="swiper" :options="swiperOption">
    <swiper-slide v-for="item in imageList" :key="item">
      <img :src="item.imgUrl" />
    </swiper-slide>
    <div
      class="swiper-pagination swiper-pagination-white"
      slot="pagination"
    ></div>
  </swiper>
</template>

<script>
import { Swiper, SwiperSlide } from "vue-awesome-swiper";
import "swiper/css/swiper.css";
export default {
  name: "swiper-example-fade-effect",
  title: "Fade effect",
  props: {
    imageList: Array,
  },
  components: {
    Swiper,
    SwiperSlide,
  },
  data() {
    return {
      swiperOption: {
        spaceBetween: 30,
        effect: "fade",
        delay: 1000,
        autoplay: true,
        loop: true,
        pagination: {
          el: ".swiper-pagination",
          clickable: true,
        },
      },
    };
  },
};
</script>

<style lang="scss" scoped>
.swiper {
  height: 360px;
  border-radius: 8px;
  .swiper-slide {
    background-position: center;
    background-size: cover;
    background-color: white;
    color: white;
    img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}
/deep/.swiper-pagination-bullet-active {
  background-color: gold;
}
/deep/.swiper-pagination-bullet {
  background-color: aqua;
}
</style>
